<?php
namespace app\model\oa;

use app\model\BaseModel;

/**
 * 发票模型
 * 对应数据库表: oa_invoice (发票表)
 */
class Invoice extends BaseModel
{
    // 设置表名（不包含前缀）
    protected $name = 'invoice';
    
    // 设置主键
    protected $pk = 'id';
    
    // 设置字段类型
    protected $type = [
        'customer_id' => 'integer',
        'contract_id' => 'integer',
        'project_id' => 'integer',
        'amount' => 'float',
        'did' => 'integer',
        'admin_id' => 'integer',
        'open_status' => 'integer',
        'open_admin_id' => 'integer',
        'open_time' => 'datetime',
        'types' => 'integer',
        'invoice_type' => 'integer',
        'invoice_subject' => 'integer',
        'enter_amount' => 'float',
        'enter_status' => 'integer',
        'enter_time' => 'datetime',
        'create_time' => 'int',
        'update_time' => 'int',
        'check_status' => 'integer',
        'check_flow_id' => 'integer',
        'check_step_sort' => 'integer',
        'check_time' => 'datetime'
    ];

    // 可搜索字段
    protected $searchField = [
        'code',
        'customer_id',
        'contract_id',
        'open_status',
        'enter_status'
    ];
}